const rng = {
	namespaced:true,
	state : {
		nm:1,
		newUsername:true,
		denglu:'请登录'
	},
	mutations : {
	   abcd(state,deng){
		  
		  state.newUsername = false;
		  state.denglu = deng;
		  
		  //this.$router.push('/')
	   }
	},
	actions:{
		jia(state,payload){
			var a =  JSON.parse(localStorage.getItem('good'));
			a[payload].num ++;
			localStorage.setItem('good',JSON.stringify(a))
			
		},
		
		jian(state,payload){
			var a =  JSON.parse(localStorage.getItem('good'));
			if(a[payload].num > 1){
				a[payload].num --;
				localStorage.setItem('good',JSON.stringify(a))
				
			}
			
		},
		alter(state,deng){
			state.commit('abcd',deng); 
		}
	},
	getters:{
		allMoney( state ){
			 m = state.nm;
			return m;
		}
	}
}
export default rng;